const {app, BrowserWindow} = require('electron')
const path = require('path')
const isDev = require('electron-is-dev')

let mainWin = null
app.on('ready', () => {
    mainWin = new BrowserWindow({
        width: 800,
        height: 600,
        minWidth: 600,
        webPreferences: {
            nodeIntegration: true,
            contextIsolation: false,
            preload: path.resolve(__dirname, './preload.js')
            // sandbox
        }
    })
    const env_url = isDev ? 'http://localhost:3000' : '生产url'
    mainWin.loadURL(env_url)
})